<?php
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    //echo "get";
    if (isset($_GET['myname'])) {
        $param_value = $_GET['myname'];
    } else {
        // 参数未传递的处理逻辑
    }

    $a = array('status' => 'get_success','name'=>$param_value);
    $b = json_encode($a);
    echo $b;
    // GET请求处理逻辑
} else if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // POST请求处理逻辑
    echo "post";
} else {
    http_response_code(405); // 设置错误状态码 - Method Not Allowed
    echo "Method not allowed";
    exit;
}
//echo "1111";
//echo phpinfo();
/*function test() {
    echo "2222";
}*/
?>
